-
Notifications
You must be signed in to change notification settings - Fork 411
Wait to free the holding cell during channel_reestablish handling #1859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wait to free the holding cell during channel_reestablish handling #1859
Conversation
Asserting that specific log entries were printed isn't all that useful, we should really be focusing on the expected messages (or, when a monitor udpate fails, the lack thereof). In the next commit one of these log checks would otherwise break due to the particular time a monitor update fails changing, but I also plan on reworking the montior update flows substantially soon, breaking lots of them.
When we process a `channel_reestablish` message we free the HTLC update holding cell as things may have changed while we were disconnected. However, some time ago, to handle freeing from the holding cell when a monitor update completes, we added a holding cell freeing check in `get_and_clear_pending_msg_events`. This leaves the in-`channel_reestablish` holding cell clear redundant, as doing it immediately or is `get_and_clear_pending_msg_events` is not a user-visible difference. Thus, we remove the redundant code here, substantially simplifying `handle_chan_restoration_locked` while we're at it.
There is no reason anymore for `handle_chan_restoration_locked` to be a macro, and our long-term desire is to move away from macros as they substantially bloat our compilation time (and binary size). Thus, we simply remove `handle_chan_restoration_locked` here and turn it into a function.
755f15c
to
f1c6cd8
Compare
Codecov ReportBase: 90.61% // Head: 90.70% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1859 +/- ##
==========================================
+ Coverage 90.61% 90.70% +0.09%
==========================================
Files 90 90
Lines 47623 47552 -71
Branches 47623 47552 -71
==========================================
- Hits 43152 43132 -20
+ Misses 4471 4420 -51
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM I think
Now that `handle_channel_resumption` can't fail, the error handling in `post_handle_chan_restoration` is now dead code. Removing it makes `post_handle_chan_restoration` only a single block, so here we simply remove the macro and inline the single block into the two places the macro was used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we process a
channel_reestablish
message we free the HTLCupdate holding cell as things may have changed while we were
disconnected. However, some time ago, to handle freeing from the
holding cell when a monitor update completes, we added a holding
cell freeing check in
get_and_clear_pending_msg_events
. Thisleaves the in-
channel_reestablish
holding cell clear redundant,as doing it immediately or is
get_and_clear_pending_msg_events
isnot a user-visible difference.
Thus, we remove the redundant code here, substantially simplifying
handle_chan_restoration_locked
while we're at it.